﻿Public Class DialogSearchItem
    Public Overrides Sub setcombocari()
        MyBase.setcombocari()
        Dim dt As New DataTable
        ComCariBy.Items.Clear()
        If Utils.executeSP("proc_showallcolumn", New Object() {TableKategori}, dt) Then
            If dt IsNot Nothing Then
                If dt.Rows.Count > 0 Then
                    For Each dr As DataRow In dt.Rows
                        ComCariBy.Items.Add(dr("Field"))

                    Next
                    ComCariBy.SelectedIndex = 0
                End If
            End If
        End If
    End Sub
    Public Overrides Sub searchitem(ByVal finder As String)
        MyBase.searchitem(finder)
        Dim dtitem As New DataTable
        Dim obj() As Object
        If finder = "all" Then
            obj = New Object() {ColoumnDisplay, TableKategori, ComCariBy.Text, ""}
        Else
            obj = New Object() {ColoumnDisplay, TableKategori, ComCariBy.Text, txtKunci.Text}
        End If
        If Utils.executeSP("proc_searchall", obj, dtitem) Then
            If dtitem IsNot Nothing Then
                DGVitem.DataSource = dtitem
            End If
        End If
    End Sub
End Class
